package com.sq.subject.common.enums;

import lombok.Getter;

/**
 * 题目类型枚举
 * 1 单选 2多选 3 判断 4 简答
 * @author quan
 */
@Getter
public enum SubjectInfoTypeEnum {
    RADIO(1,"单选"),
    MULTIPLE(2,"多选"),
    JUDGE(3,"判断"),
    SIMPLE(4,"简答");

    public Integer code;
    public String desc;

    SubjectInfoTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }
    public static SubjectInfoTypeEnum getByCode(int code){
        for (SubjectInfoTypeEnum value : SubjectInfoTypeEnum.values()) {
            if(value.getCode() == code){
                return value;
            }
        }
        return null;
    }
}
